// 配路由-一级路由
import Vue from 'vue'
import VueRouter from 'vue-router'

import MainPage from '@/views/MainPage'
import ArticleDetail from '@/views/ArticleDetail'
import ArticleList from '@/views/ArticleList'
import MainCollect from '@/views/MainCollect'
import MainLike from '@/views/MainLike'
import MainMy from '@/views/MainMy'

Vue.use(VueRouter)
const router = new VueRouter({
  routes:[
    {
      path:'/',
      component: MainPage,
      // 强制跳转
      redirect:'/article',
      // 配置二级路由
      children:[
        {
          path:'/article',
          component: ArticleList
        },
        {
          path:'/collect',
          component: MainCollect
        },
        {
          path:'/like',
          component: MainLike
        },
        {
          path:'/my',
          component: MainMy
        },
    ]
    },
    {
      path:'/detail',
      component: ArticleDetail
    }
  ]
})
export default router